package com.ruoyi.web.tdmdata.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.web.tdmdata.mapper.TdmYaoYongZhiWuMapper;
import com.ruoyi.web.tdmdata.domain.TdmYaoYongZhiWu;
import com.ruoyi.web.tdmdata.service.ITdmYaoYongZhiWuService;

/**
 * 药用植物Service业务层处理
 * 
 * @author ly
 * @date 2022-03-14
 */
@Service
public class TdmYaoYongZhiWuServiceImpl implements ITdmYaoYongZhiWuService 
{
    @Autowired
    private TdmYaoYongZhiWuMapper tdmYaoYongZhiWuMapper;

    /**
     * 查询药用植物
     * 
     * @param id 药用植物主键
     * @return 药用植物
     */
    @Override
    public TdmYaoYongZhiWu selectTdmYaoYongZhiWuById(Long id)
    {
        return tdmYaoYongZhiWuMapper.selectTdmYaoYongZhiWuById(id);
    }

    /**
     * 查询药用植物列表
     * 
     * @param tdmYaoYongZhiWu 药用植物
     * @return 药用植物
     */
    @Override
    public List<TdmYaoYongZhiWu> selectTdmYaoYongZhiWuList(TdmYaoYongZhiWu tdmYaoYongZhiWu)
    {
        return tdmYaoYongZhiWuMapper.selectTdmYaoYongZhiWuList(tdmYaoYongZhiWu);
    }

    /**
     * 新增药用植物
     * 
     * @param tdmYaoYongZhiWu 药用植物
     * @return 结果
     */
    @Override
    public int insertTdmYaoYongZhiWu(TdmYaoYongZhiWu tdmYaoYongZhiWu)
    {
        tdmYaoYongZhiWu.setCreateTime(DateUtils.getNowDate());
        return tdmYaoYongZhiWuMapper.insertTdmYaoYongZhiWu(tdmYaoYongZhiWu);
    }

    /**
     * 修改药用植物
     * 
     * @param tdmYaoYongZhiWu 药用植物
     * @return 结果
     */
    @Override
    public int updateTdmYaoYongZhiWu(TdmYaoYongZhiWu tdmYaoYongZhiWu)
    {
        tdmYaoYongZhiWu.setUpdateTime(DateUtils.getNowDate());
        return tdmYaoYongZhiWuMapper.updateTdmYaoYongZhiWu(tdmYaoYongZhiWu);
    }

    /**
     * 批量删除药用植物
     * 
     * @param ids 需要删除的药用植物主键
     * @return 结果
     */
    @Override
    public int deleteTdmYaoYongZhiWuByIds(Long[] ids)
    {
        return tdmYaoYongZhiWuMapper.deleteTdmYaoYongZhiWuByIds(ids);
    }

    /**
     * 删除药用植物信息
     * 
     * @param id 药用植物主键
     * @return 结果
     */
    @Override
    public int deleteTdmYaoYongZhiWuById(Long id)
    {
        return tdmYaoYongZhiWuMapper.deleteTdmYaoYongZhiWuById(id);
    }
}
